<template>
  <div class="dashboard-container">
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="date" label="线路" width="180"></el-table-column>
      <el-table-column prop="name" label="速度" width="180"></el-table-column>
      <el-table-column fixed="right" label>
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="primary" size="small">选择</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { mapGetters } from "vuex";

export default {
  name: "Dashboard",
  data() {
    return {
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        }
      ],
      id:""
    };
  },
 methods:{
    handleClick(row){
   this.id = row.id;
  },
 },
  computed: {
    ...mapGetters(["name"])
  }
};
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
}
</style>
